//  https://iai.sh.cn/problem/238
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int b = n;
  int v = 0;
  while (n > 0) {
    int ge = n % 10;
    if (ge != 0 && ge != 1 && ge != 8 && ge != 6 && ge != 9) {
      cout << "Not a strobogrammatic number";
      return 0;
    }
    if (ge == 6) {
      ge = 9;
    } else if (ge == 9) {
      ge = 6;
    }
    v = v * 10 + ge;
    n = n / 10;
  }

  if (v == b) {
    cout << "Strobogrammatic number";
  } else {
    cout << "Not a strobogrammatic number";
  }

  return 0;
}